<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Index</title>
</head>
<script src="${pageContext.request.contextPath}/js/jquery-1.12.4.js"></script>
<body>
<img src="${pageContext.request.contextPath}/${imges.imge}" id="userimgId" class="layui">
<a href="${pageContext.request.contextPath}/imges/sub"></a>
<div>
    ${imges.texts}
</div>
<div align="center">
    <nav aria-label="Page navigation">
        <ul class="pagination">
            <c:if test="${pi.hasPreviousPage}">
                <li>
                    <a href="${pageContext.request.contextPath}/product/show?pageNum=${pi.pageNum-1}&tid=${param.tid}" aria-label="Previous">
                        <span aria-hidden="true">上页</span>
                    </a>
                </li>
            </c:if>
            <%--				pages总页数  pageNum当前页数	hasPreviousPage是否有上页  hasNextPage是否有下页--%>
            <c:forEach begin="1" end="${pi.pages}" var="index">
                <%--						判断激活，激活效果--%>
                <c:if test="${pi.pageNum==index}">
                    <li class="active"><a href="${pageContext.request.contextPath}/product/show?pageNum=${index}&tid=${param.tid}">${index}</a></li>
                </c:if>
                <c:if test="${pi.pageNum!=index}">
                    <li ><a href="${pageContext.request.contextPath}/product/show?pageNum=${index}&tid=${param.tid}">${index}</a></li>
                </c:if>
            </c:forEach>
            <c:if test="${pi.hasNextPage}">
                <li>
                    <a href="${pageContext.request.contextPath}/product/show?pageNum=${pi.pageNum+1}&tid=${param.tid}" aria-label="Next">
                        <span aria-hidden="true">下页</span>
                    </a>
                </li>
            </c:if>

        </ul>
    </nav>
</div>
<script>

</script>
</body>
</html>
